package com.bbyl.im.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 接口返回基类
 */
public class RemoteResponse implements Parcelable {

    private int uid;

    private int success;

    private String error_msg;

    private int error_code;

    private int os;

    private float osv;

    private String deivce_id;

    public boolean isSuccess() {
        return 1 == success;
    }

    public int getOs() {
        return os;
    }

    public void setOs(int os) {
        this.os = os;
    }

    public float getOsv() {
        return osv;
    }

    public void setOsv(float osv) {
        this.osv = osv;
    }

    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public int getSuccess() {
        return success;
    }

    public void setSuccess(int success) {
        this.success = success;
    }

    public String getError_msg() {
        return error_msg;
    }

    public void setError_msg(String error_msg) {
        this.error_msg = error_msg;
    }

    public int getError_code() {
        return error_code;
    }

    public void setError_code(int error_code) {
        this.error_code = error_code;
    }

    public String getDeivce_id() {
        return deivce_id;
    }

    public void setDeivce_id(String deivce_id) {
        this.deivce_id = deivce_id;
    }

    @Override
    public String toString() {
        return "BaseResult{" +
                "uid='" + uid + '\'' +
                ", success=" + success +
                ", os=" + os +
                ", osv=" + osv +
                '}';
    }

    public RemoteResponse(int uid, int success, String error_msg, int error_code, int os, float osv, String deivce_id) {
        this.uid = uid;
        this.success = success;
        this.error_msg = error_msg;
        this.error_code = error_code;
        this.os = os;
        this.osv = osv;
        this.deivce_id = deivce_id;
    }

    public RemoteResponse(Parcel in) {
        uid = in.readInt();
        success = in.readInt();
        error_msg = in.readString();
        error_code = in.readInt();
        os = in.readInt();
        osv = in.readFloat();
        deivce_id = in.readString();
    }

    public RemoteResponse(){}

    public static final Creator<RemoteResponse> CREATOR = new Creator<RemoteResponse>() {
        @Override
        public RemoteResponse createFromParcel(Parcel in) {
            return new RemoteResponse(in);
        }

        @Override
        public RemoteResponse[] newArray(int size) {
            return new RemoteResponse[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(uid);
        dest.writeInt(success);
        dest.writeString(error_msg);
        dest.writeInt(error_code);
        dest.writeInt(os);
        dest.writeFloat(osv);
        dest.writeString(deivce_id);
    }

}
